// 路由配置
// @ 表示的是src的根路径
import Home from '../views/home'
import CateGory from '../views/category'
import Cart from '../views/cart'
import TabBar from '../components/tab-bar'
import NavBar from '../components/nav-bar'
import Mine from '../views/mine'
import Detail from '../views/detail'
import Login from '../views/login'
// 路由设置
const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    components: {
      default: Home,
      footer: TabBar,
    },
    meta: {
      //  路由源信息，开发过程中要使用到与当前路由相关的数据
      title: '首页',
      icon: '&#xe668;',
      inTabBar: true,
    },
  },
  {
    path: '/category',
    components: {
      default: CateGory,
      header: NavBar,
      footer: TabBar,
    },
    meta: {
      title: '分类',
      icon: '&#xe66b;',
      inTabBar: true,
    },
  },
  {
    path: '/cart',
    components: {
      default: Cart,
      footer: TabBar,
      header: NavBar,
    },
    meta: {
      title: '购物车',
      icon: '&#xe628;',
      inTabBar: true,
    },
  },
  {
    path: '/mine',
    components: {
      default: Mine,
      footer: TabBar,
      header: NavBar,
    },
    meta: {
      title: '我的',
      icon: '&#xe67a;',
      inTabBar: true,
    },
  },
  {
    path: '/detail',
    components: {
      default: Detail,
      footer: TabBar,
    },
  },
  {
    path: '/login',
    components: {
      default: Login,
    },
  },
]
export default routes
